* REPLICATION DO-FILE
*
* WHY DO ETHNIC GROUPS REBEL?
* Lars Erik-Cederman, Andreas Wimmer, and Brian Min
* World Politics 62:1 (January 2010)


* NOTE: WarID and WarID2 columns are associated with EPR periods. 
* Onset year is indicated by newethonset variable.



set more off
use EPRGroupsRebelReplication, clear


**************************************************************************
* TABLE 1 Descriptive Stats
tab stat newethonset


**************************************************************************
* TABLE 2 Main regression results
* Model 1
logit newethonset excluded downgraded2 lrsize warhist lgdpcapl lpopl ///
	gpeaceyears gspline* if ongoingdrop==0 & monop==0 & dominant==0 & status!="IRRELEVANT", nolog cluster(cowcode)

* Model 2
logit newethonset junior autonomy powerless discrim separatist downgraded2 lrsize warhist lgdpcapl lpopl ///
	gpeaceyears gspline* if ongoingdrop==0 & monop==0 & dominant==0 & status!="IRRELEVANT", nolog cluster(cowcode)

* Model 3
logit newethonset powerless discrim separatist downexcl2 lrsize warhist lgdpcapl lpopl ///
	gpeaceyears gspline* if ongoingdrop==0 & egip==0 & status!="IRRELEVANT", nolog cluster(cowcode)

* Model 4
preserve

* DROP ALL BUT JP AND SPs
	drop if excluded==1
	drop if pwrshare==0
	drop if ethrelevant==1
	drop if stat==.
	
	gen nonsecethonset = newethonset == 1 & secethonset == 2
	gen secethonset2 = newethonset == 1 & secethonset == 1
	tab newethonset
	* CORRECT DOWNGRADED STATUS OF YAKOMA, CENTRAL AFRICAN REPUBLIC 2003
	replace downgraded2=0 if cowgroupid==48206080 &  year==2003

logit newethonset junior dwegip2 underrepr lrsize warhist lgdpcapl lpopl ///
	gpeaceyears gspline* if  ongoingdrop==0 & status!="IRRELEVANT", nolog cluster(cowcode)

restore


**************************************************************************
* TABLE 3 Sensitivity Analysis

* Model 1
* Region dummies
logit newethonset excluded downgraded2 lrsize warhist lgdpcapl lpopl ///
	gpeaceyears gspline* nafrme lamerica ssafrica eeurop asia if ongoingdrop==0 & monop==0 & dominant==0 & status!="IRRELEVANT", nolog cluster(cowcode)

* Model 2
* Country fixed effects
xi: logit newethonset excluded downgraded2 lrsize warhist lgdpcapl lpopl ///
	i.cowcode ///
	gpeaceyears gspline* if ongoingdrop==0 & monop==0 & dominant==0 & status!="IRRELEVANT", nolog


* Model 3
* Hi intensity onsets only
logit newethhionset excluded downgraded2 lrsize warhist lgdpcapl lpopl ///
	gpeaceyears gspline* if ongoingdrop==0 & monop==0 & dominant==0 & status!="IRRELEVANT", nolog cluster(cowcode)

